package com.boil.qz.safekavass.web.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;

/**
 * Created by ChenYong on 2017-04-13.
 * <br>
 * 题目列表的请求参数。
 */
public class QuestionListParam extends Page2Param {
    /**
     * 行业代码
     */
    @Pattern(regexp = Constants.INDUSTRY_CODE_EMPTY_RE, message = Constants.INDUSTRY_CODE_RE_MSG)
    private String industryCode;
    /**
     * 题目
     */
    @Length(min = Constants.VALUE_0, max = Constants.VALUE_200, message = "题目的长度在0至200个字之间")
    private String questionTitle;
    /**
     * 类型
     */
    @Length(min = Constants.VALUE_0, max = Constants.VALUE_1, message = "类型的长度在0至1个数字之间")
    @Pattern(regexp = Constants.NUMBER_EMPTY_RE, message = ("类型" + Constants.NUMBER_RE_MSG))
    private String questionType;
    /**
     * 答案
     */
    @Length(min = Constants.VALUE_0, max = Constants.VALUE_4, message = "答案的长度在0至4个字母之间")
    @Pattern(regexp = Constants.ABCD_EMPTY_RE, message = ("答案" + Constants.ABCD_EMPTY_RE_MSG))
    private String questionAnswer;

    /**
     * 默认构造器。
     */
    public QuestionListParam() {
        super();
    }

    public String getIndustryCode() {
        return industryCode;
    }

    public void setIndustryCode(String industryCode) {
        this.industryCode = industryCode;
    }

    public String getQuestionTitle() {
        return questionTitle;
    }

    public void setQuestionTitle(String questionTitle) {
        this.questionTitle = questionTitle;
    }

    public String getQuestionType() {
        return questionType;
    }

    public void setQuestionType(String questionType) {
        this.questionType = questionType;
    }

    public String getQuestionAnswer() {
        return questionAnswer;
    }

    public void setQuestionAnswer(String questionAnswer) {
        this.questionAnswer = questionAnswer;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("QuestionListParam{");
        sb.append("startDate='").append(startDate).append('\'');
        sb.append(", iDisplayStart=").append(iDisplayStart);
        sb.append(", industryCode='").append(industryCode).append('\'');
        sb.append(", sEcho=").append(sEcho);
        sb.append(", endDate='").append(endDate).append('\'');
        sb.append(", questionTitle='").append(questionTitle).append('\'');
        sb.append(", iDisplayLength=").append(iDisplayLength);
        sb.append(", iColumns=").append(iColumns);
        sb.append(", questionType='").append(questionType).append('\'');
        sb.append(", iSortingCols=").append(iSortingCols);
        sb.append(", questionAnswer='").append(questionAnswer).append('\'');
        sb.append('}');
        return sb.toString();
    }
}